#include "udpServer.hpp"
#include <memory> // 智能指针

using namespace Server;
using namespace std;

void Usage(string proc)
{
    cout << "Usage:\n\t" << proc << "  local_ip local_port\n\n";
}

int main(int argc, char *argv[])
{

    if (argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t port = atoi(argv[2]);
    // string ip = argv[1];

    std::unique_ptr<udpServer> usvr(new udpServer(port));

    usvr->initServer();

    usvr->start();

    return 0;
}